<?php 
/**
 *TOP排行榜静态类
 */
class App_top{
	/**
	 * 获取排行榜总数
	 */
	public static function getTopCount($table){
		$Db = loadDB();
		$result= $Db->getOne("SELECT COUNT(*) AS `count` FROM `{$table}`");
		return $result;
	}
	/**
	 * 获取排行榜信息
	 */
	public static function getTopList($table , $type , $pageSize, $pageCount){
		$Db = loadDB();
		$pageSize=($pageSize-1)*$pageCount;
		$result = $Db->getAll("SELECT * FROM `{$table}` ORDER BY `{$type}` DESC LIMIT {$pageSize} , {$pageCount}");
		return $result;
	}
}

# end of script